UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1cV/q4PX1bqVG3M+92OqWWsGozH1t2rYq+k38+loXsc='
WHERE
key_id = '3ee5e3dcf17e30ee421be57945b7e3e154df003f016914ce0b08d87428ae476f'
AND (
token = '1cV/q4PX1bqVG3M+92OqWWsGozH1t2rYq+k38+loXsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)