UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H7jJvZsmu/jvPjntZJvjQ/SsB/jg8o7dT7H8pCe5dLk='
WHERE
key_id = '36b2960affedc4e6e62a524a27c788c17aeb08ca0fcd6c17b17b599562c69091'
AND (
token = 'H7jJvZsmu/jvPjntZJvjQ/SsB/jg8o7dT7H8pCe5dLk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)