UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bjl+o5Yf/8stulFlUqCwYuIzcqKgnobLj+HRr6Oo6Cw='
WHERE
key_id = '82a640c7526d2cca51db69181ded2cf38f1b42b5a199bed25c6b6be4a86d2631'
AND (
token = 'Bjl+o5Yf/8stulFlUqCwYuIzcqKgnobLj+HRr6Oo6Cw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)