UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xyIuwZm7nybIyEJeMMNgvFQyl0OOgqQx7kdGWxpNgIA='
WHERE
key_id = '5b257acfdab07964c70a0ffa1968993e1a63d88d1029ddea77dd5c89b192881e'
AND (
token = 'xyIuwZm7nybIyEJeMMNgvFQyl0OOgqQx7kdGWxpNgIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)