UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '20EXMbXas/xySeDs/AYwb3AJE6Q50nNxMbOOGFPDAwU=' 
WHERE 
  key_id = '68324d632f1eb9e95a6b16837fdbb4cdc63b85f4e30c65d69ca430ce41170af4' 
  AND (
    token = '20EXMbXas/xySeDs/AYwb3AJE6Q50nNxMbOOGFPDAwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031