UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '26rTeCRLDbjXbwYPkVUzEmF/fU8VhamciceHdmNPGFg=' 
WHERE 
  key_id = '046473bb19393e70fe89077eb39f05f9b4e9b08ef8b163d5754769865446ade0' 
  AND (
    token = '26rTeCRLDbjXbwYPkVUzEmF/fU8VhamciceHdmNPGFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027