UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L6bna6cIzxKYhPiU5JggCcS5EWJTDjozmzi3kjmEuAQ=' 
WHERE 
  key_id = '611c7564dc1ae7a38bd04161e026ce8341fbd12a020f3b6a89f46d9e103b513b' 
  AND (
    token = 'L6bna6cIzxKYhPiU5JggCcS5EWJTDjozmzi3kjmEuAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042