UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cvL+mdQ7imtBwqI+BH4TLeHD/PMEl3CZl14IMWXqF7c='
WHERE
key_id = 'ab9b774844a7eeb6fdee615ede0224f6593725e46699214227aebbcd3b592393'
AND (
token = 'cvL+mdQ7imtBwqI+BH4TLeHD/PMEl3CZl14IMWXqF7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)