UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QWR1NVQWohAy2WYML1GW/6LmMfAucpIERESaHO4X5Zo='
WHERE
key_id = 'c393efc5b5dbe32d5cf495fd47e4a956d47f7df50eedcfe7b143881ecf7c5a8f'
AND (
token = 'QWR1NVQWohAy2WYML1GW/6LmMfAucpIERESaHO4X5Zo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)