UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '96hGIFKApMn10KgrToOmoUC5f9jL6lvrwgxhzfIwHZc=' 
WHERE 
  key_id = 'e0bffc1c64ca90f24a85e12f74f3d1f278986598ceec47101fe25c51253fe4d9' 
  AND (
    token = '96hGIFKApMn10KgrToOmoUC5f9jL6lvrwgxhzfIwHZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046