UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '39kJi+r/xLtsxZrRLJCKNyjsVGs4gkj3VO4jR9F9pmw='
WHERE
key_id = '107289c1b21ff8e7325c3df176ca92a3138ddb85f1d301bec61a76a3ff3891c3'
AND (
token = '39kJi+r/xLtsxZrRLJCKNyjsVGs4gkj3VO4jR9F9pmw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)