UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'inMMH82n6S2pHvU0VHLCC6qclA6xHIKX5xdXxmp/Gis=' 
WHERE 
  key_id = 'a39c2e6fc1edb5000956cab700a3b1a55221999c8ef2db9775983892692e9428' 
  AND (
    token = 'inMMH82n6S2pHvU0VHLCC6qclA6xHIKX5xdXxmp/Gis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026