UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd5VNx1I1u09Gz6+v++uxam+dChwRa90gvx5/RHrBXa4='
WHERE
key_id = 'da154c336ab9a17586e8c57267db02795dc0bb39581701cce4910b577ccbbd51'
AND (
token = 'd5VNx1I1u09Gz6+v++uxam+dChwRa90gvx5/RHrBXa4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)