UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3wAegU4bk/ZXq/NLgaO1Esuxb+iUo/7iux/j5NYHeH0='
WHERE
key_id = 'a231ae7852e8419f7e21c47045728bf76a7b17bd5cdf11a1c43782bccbe0ac7e'
AND (
token = '3wAegU4bk/ZXq/NLgaO1Esuxb+iUo/7iux/j5NYHeH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)