UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kPQ86EKTlQRGDj9whWYaITxISt9rPgUQgx7/KguX+Rc=' 
WHERE 
  key_id = 'acb060d1b72e6a4ed5093a543f43a30e12b0a3228f1e9c8e6f2162efcdf34e3a' 
  AND (
    token = 'kPQ86EKTlQRGDj9whWYaITxISt9rPgUQgx7/KguX+Rc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030