UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EasYCwQkxe09FjcvdfRthYa15F7pAQdc1OagNWb5VPw=' 
WHERE 
  key_id = '4c35d77f3fa014cc7e28b6a5e6d33e26a02ea12bbe8ccd6e7e8eaf208766e407' 
  AND (
    token = 'EasYCwQkxe09FjcvdfRthYa15F7pAQdc1OagNWb5VPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029