UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nmn/yv/r7EFuH5NEmz3NzJNJ8n04hdgES7vng8b7fpM=' 
WHERE 
  key_id = '381404602912c98daed08941d2b6b28fb37c4a7688b6d3a9ca70c627afc4a21e' 
  AND (
    token = 'Nmn/yv/r7EFuH5NEmz3NzJNJ8n04hdgES7vng8b7fpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042