UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'znFeANXbMkoeb2F4bKP5SyHgFcDXsDksFBrrcxQmnew='
WHERE
key_id = '1dbc85a15be4771cceb4184466ff6a8fd71421fd545a4f2aa40debe252fd91cd'
AND (
token = 'znFeANXbMkoeb2F4bKP5SyHgFcDXsDksFBrrcxQmnew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)