UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cxs+9ooIwsCaFNb8PX1umbmQk15uUdf1j6k+Ch5MQME=' 
WHERE 
  key_id = 'b808b3625f768fbe8eea308505d1bd46358cb1a62df9f09740b0d0b05de6c2e7' 
  AND (
    token = 'Cxs+9ooIwsCaFNb8PX1umbmQk15uUdf1j6k+Ch5MQME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019