UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GIMOZUBBRJQmWdPt7ZDaE16n8oriwCBLDtIrxcshOmw=' 
WHERE 
  key_id = 'b5e7f6391f6f25a43befea6a7f5c4bb19393dace22dbadb28c95e57be8e2e065' 
  AND (
    token = 'GIMOZUBBRJQmWdPt7ZDaE16n8oriwCBLDtIrxcshOmw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034