UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e1HbzRYIj7ZFd9/2T/8EqC7aF1YzB2i9WY21RXvvUNM='
WHERE
key_id = 'fc85cd3fb99d7c9becace2116b0b0514c420c9114ab48efe6977ce6cace362d3'
AND (
token = 'e1HbzRYIj7ZFd9/2T/8EqC7aF1YzB2i9WY21RXvvUNM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)