UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B6ITXfL9ABHZJa4qGqHz7kF3YtFWo8EqQGXHOkfrsMU='
WHERE
key_id = '75caf7a3e7cd166ebfb9ce9ce6b27a0e173a66889cae18a6a8c7a49b0c5fc8d0'
AND (
token = 'B6ITXfL9ABHZJa4qGqHz7kF3YtFWo8EqQGXHOkfrsMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)