UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jTEnMBhu5h/XOFdOJsm+SekxWNxI7Ioxc3YQaMNx0yY=' 
WHERE 
  key_id = '115ff83385a3d53c51e266a7c3cf576d52ceb3d8274db9bc961452264d19d777' 
  AND (
    token = 'jTEnMBhu5h/XOFdOJsm+SekxWNxI7Ioxc3YQaMNx0yY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031