UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Atki68pyatEZA2UOW32EYg3lmHVdnpbyOUF5vv+YuJM='
WHERE
key_id = '06e25f5dad0d61f7004c16a81f07c676452d921b35a60e2ca1d5232c4e053a9c'
AND (
token = 'Atki68pyatEZA2UOW32EYg3lmHVdnpbyOUF5vv+YuJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)