UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xp0yD/HKxrh2Tf8shPubrOoQZ0W7cv/oibdL8sgTS6U='
WHERE
key_id = '3263401f60b4a5cd3ed19f858c5159b9a796c246e6b2ebe660332970ce5b3cec'
AND (
token = 'xp0yD/HKxrh2Tf8shPubrOoQZ0W7cv/oibdL8sgTS6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)