UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5kGzYJeI8dI9dDVeshkVIVLx5cvLzT78RtRcT3Z/2mg=' 
WHERE 
  key_id = '61a06e2f49d7a85a7dc185ec3c0b370007967661c9cff4cfb1da8b4c10623774' 
  AND (
    token = '5kGzYJeI8dI9dDVeshkVIVLx5cvLzT78RtRcT3Z/2mg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039