UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'klKxYTkX5jWEFG7gpkBxIfk9F/Sq2HGuN6P21zIKTpM='
WHERE
key_id = '352f932c64fe37c05200d00e1ecb24622b03950f68d7ffa7002c8bf0244ffd8b'
AND (
token = 'klKxYTkX5jWEFG7gpkBxIfk9F/Sq2HGuN6P21zIKTpM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)