UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'irrt3CGndMdBX1U/TQSqyQgVXKsOTsof8SCGRnX6UxU=' 
WHERE 
  key_id = '5673ecdad3b49a4050e7f380bd9b21f3e44bf0fc4537b488aafad20f631d6988' 
  AND (
    token = 'irrt3CGndMdBX1U/TQSqyQgVXKsOTsof8SCGRnX6UxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027