UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TzRresb7B7UJu0Iv/+sseaz+1a8TN6M8mR1MUfHHLPk='
WHERE
key_id = '2cba12770b7a048ccf6a9941dbefef2ad10964ba2a7ef4c24972fec8b4e53da0'
AND (
token = 'TzRresb7B7UJu0Iv/+sseaz+1a8TN6M8mR1MUfHHLPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)