UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UA0KX6ceQ5Gups1MRJPcCABrrRzMgUnRXrBhHWK+Ts0=' 
WHERE 
  key_id = '361916032bb695e2130f712f1fcc85d52c400686086a0758fdaee2cad676fb2f' 
  AND (
    token = 'UA0KX6ceQ5Gups1MRJPcCABrrRzMgUnRXrBhHWK+Ts0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036