UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RZ8DmD5LMncLQ0yj2FZPg8w2g9MjthV3OZaQp7DjitE='
WHERE
key_id = '63836106ecb5d83138c579ce541559d4b2fe7e837186c90bbd0537630e3187bc'
AND (
token = 'RZ8DmD5LMncLQ0yj2FZPg8w2g9MjthV3OZaQp7DjitE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)