UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DQfazqxkOuzyVjSevoHRma37qJG3xUNXXn9VGdqr31s='
WHERE
key_id = 'ab987b32376b46f2405ea4e2cc5b1afae3d761c1dd9ca338052aa16664b846de'
AND (
token = 'DQfazqxkOuzyVjSevoHRma37qJG3xUNXXn9VGdqr31s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)