UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZSmHgw/PnVKzu44HX1LhzsJGfL8ke7ZSPcJQiglbWYU=' 
WHERE 
  key_id = 'becde22d8a4292b0bd1da793a50f8eb1fc67897bce3e78e94040eb0b36cffe8c' 
  AND (
    token = 'ZSmHgw/PnVKzu44HX1LhzsJGfL8ke7ZSPcJQiglbWYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039