UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '32nRfsjSUVwG0w0RGREeO8TbeZ26752DVoGBHJRVJZ0='
WHERE
key_id = 'b725669d3ff6de07fc5fac7326ef27b284f7a4bd61b8e27d7cfa3295b7240be9'
AND (
token = '32nRfsjSUVwG0w0RGREeO8TbeZ26752DVoGBHJRVJZ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)