UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zTYS694HtXfIq/o+0FBE2w5Y2HzSzbMm22V/2+Dtpfg='
WHERE
key_id = '3305991902cb470695506db8e94764fd390855ffa77e734dfee26cf6bfdbdbc3'
AND (
token = 'zTYS694HtXfIq/o+0FBE2w5Y2HzSzbMm22V/2+Dtpfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)