UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7kLvfBXS931YRpmry6YfgMLOPfYwUVtI8JhODiOAPJI='
WHERE
key_id = '91ff90d699d64974fc7156caf126d5a012c94424a30e5fd61eea2758d1d29676'
AND (
token = '7kLvfBXS931YRpmry6YfgMLOPfYwUVtI8JhODiOAPJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)