UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z9qZJBlJXHbJcDaQ2/CYDdOcbGmvnponOHDr3GS/gCY=' 
WHERE 
  key_id = '16fcbcc9dbe5ea5a5acfede5c6f55d9d856d5b3d94e6c483aca3dc5c3a0448ea' 
  AND (
    token = 'z9qZJBlJXHbJcDaQ2/CYDdOcbGmvnponOHDr3GS/gCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023