UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oo4OpTdG5sN31kZ8JNgPKXmSK8sXq6jGdFPginyIdQA='
WHERE
key_id = '0c2297745b2ffe55b78a5e97fdc7c264845ba935974cb2526ac2c5805d9a1aa4'
AND (
token = 'oo4OpTdG5sN31kZ8JNgPKXmSK8sXq6jGdFPginyIdQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)