UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'au1x4p5KCWaFvmM19oJnhq7+X38utgYvCbzPwmF5af8='
WHERE
key_id = 'df6299f28fa1ecfdc42b1dfa3e391bfbf90427b3ecd4187bfdaa8c5664ac9c7a'
AND (
token = 'au1x4p5KCWaFvmM19oJnhq7+X38utgYvCbzPwmF5af8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)