UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QI5/TwokgiRmiSkn0LyBW9ooibjury8OpWDQtFq9ueo='
WHERE
key_id = 'e647fcc8682058c9fb9c62bcb2c48a8171205f32db853297c670823703bf4daf'
AND (
token = 'QI5/TwokgiRmiSkn0LyBW9ooibjury8OpWDQtFq9ueo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)