UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e+4qJBApb/TrXDFeHIVoBe/UodlYAJ+MhKZ/Prf+jEk=' 
WHERE 
  key_id = '5bc753ca25536316be8c06c217c3ebdb29718868de990b1ca3922b9a99f80d31' 
  AND (
    token = 'e+4qJBApb/TrXDFeHIVoBe/UodlYAJ+MhKZ/Prf+jEk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051