UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D4w/soPcvctfW8HVxZWpREIladxhuJ29kR5JZx7lC7w='
WHERE
key_id = '6017efd3920b4f9fcd1ef83260da10cb7d71408bd97732bf02883460e529fe32'
AND (
token = 'D4w/soPcvctfW8HVxZWpREIladxhuJ29kR5JZx7lC7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)